package com.baike.feign;

import com.baike.data.Result;
import com.baike.feign.fallback.OrderServiceFeignBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "baike-education-order-service",fallback = OrderServiceFeignBack.class)//服务名,找到项目
public interface OrderServiceFeign {

    //广告订单修改状态接口
    @PutMapping("/adOrder/updateAdOrderByOutTradeNo")
    Result updateAdOrderByOutTradeNo(@RequestParam("outTradeNo") String outTradeNo, @RequestParam("tradeNo") String tradeNo);
    //课程订单修改接口
    @PutMapping("/lessonOrder/updateOrderByOutTradeNo")
    Result updateOrderByOutTradeNo(@RequestParam("outTradeNo") String outTradeNo,@RequestParam("tradeNo") String TradeNo);
    //广告订单超时未支付修改接口
    @PutMapping("/adOrder/TimeOutAdOrderByOutTradeNo")
    Result TimeOutAdOrderByOutTradeNo(@RequestParam("outTradeNo") String outTradeNo);
    //课程订单超时未支付修改接口
    @PutMapping("/lessonOrder/orderTimeOut")
    Result orderTimeOut(@RequestParam("outTradeNo") String outTradeNo);
    //根据订单号查询课程订单
    @GetMapping("/lessonOrder/{OutTradeNo}")
    Result findOrderByOutTradeNo(@PathVariable("OutTradeNo")String OutTradeNo);
    //根据订单号查询广告订单接口
    @GetMapping("/adOrder/{OutTradeNo}")
    Result findAdOrderByOutTradeNo(@PathVariable("OutTradeNo")String OutTradeNo);
    //根据用户id和课程id查询订单
    @GetMapping("/lessonOrder/findOrder")
    Result findOrderBystudentId(@RequestParam("studentId")Long studentId,@RequestParam("studentId")Long lessonId);

}
